<template>
  <div id="app">
    <el-menu default-active="1">
      <el-menu-item
        :index="item.menuName"
        v-for="(item, index) in childMenuList"
        :key="index"
      >
        <div class="icon-container">
          <el-icon class="icon"><leadsPoolIcon /></el-icon>
        </div>
        <template #title>
          <div class="title">{{ item.menuZhName }}</div>
        </template>
      </el-menu-item>
    </el-menu>
  </div>
</template>
<script setup>
import leadsPoolIcon from '@/assets/font/leadsPoolIcon.vue'
import { reactive } from 'vue'

const props = defineProps({
  childMenuList: {
    type: Array,
    default: () => [],
  },
})
const childMenuList = reactive(props.childMenuList)
console.log(childMenuList)
</script>
<style scoped lang="scss">
.icon-container {
  background-color: #97a0af;
  cursor: pointer;
  border-radius: 3px;
  flex-shrink: 0;
  height: 32px;
  width: 32px;
  line-height: 32px;
  text-align: center;
  align-items: center;
}

.icon {
  width: 16px;
  height: 16px;
  margin: 0;
}

.title {
  margin-left: 10px;
  font-size: 14px;
  color: #303133;
}

.el-menu {
  padding: 16px 8px;
  border: none;
}

.el-menu-item {
  background-color: white;
  width: 100%;
  line-height: 40px;
}

.el-menu-item:hover {
  background-color: #f4f5f7;
  border-radius: 5px;
  .icon-container {
    background-color: #0052cc;
  }
}
</style>
